package com.hzw.code.fast.sys.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import com.hzw.code.fast.sys.controller.args.SysRoleArgs;
import com.hzw.code.fast.sys.controller.args.SysRolePageArgs;
import com.hzw.code.fast.sys.controller.args.SysRoleQueryArgs;
import com.hzw.code.fast.sys.dto.SysRoleDto;
import com.hzw.code.fast.sys.dto.page.SysRolePageDto;
import com.hzw.code.fast.sys.entity.SysRoleEntity;
import com.hzw.code.fast.sys.model.SysRoleModel;

import java.util.List;

/**
 * 角色表(SysRole)业务层接口
 *
 * @author 胡汉三
 * @date 2020-05-20 14:24:43
 */
public interface SysRoleService extends IService<SysRoleEntity> {
    /**
     * 保存
     *
     * @param args ${@link SysRoleArgs}
     * @throws RuntimeException ${@link RuntimeException}
     * @author code generation
     * @date 2020-05-20 14:24:43
     */
    void save(SysRoleArgs args) throws RuntimeException;


    /**
     * 通过id更新
     *
     * @param args ${@link SysRoleArgs}
     * @throws RuntimeException ${@link RuntimeException}
     * @author code generation
     * @date 2020-05-20 14:24:43
     */
    void updateById(SysRoleArgs args) throws RuntimeException;


    /**
     * 分页查询
     *
     * @param args ${@link SysRolePageArgs}
     * @throws RuntimeException ${@link RuntimeException}
     * @return IPage<SysRolePageDto> ${@link IPage<SysRoleDto>}
     * @author code generation
     * @date 2020-05-20 14:24:43
     */
    IPage<SysRolePageDto> page(SysRolePageArgs args) throws RuntimeException;


    /**
     * 条件查询多条
     *
     * @param args ${@link SysRoleQueryArgs}
     * @throws RuntimeException ${@link RuntimeException}
     * @return List<SysRoleDto> ${@link List<SysRoleDto>}
     * @author code generation
     * @date 2020-05-20 14:24:43
     */
    List<SysRoleDto> selectListByModel(SysRoleQueryArgs args) throws RuntimeException;


    /**
     * 通过id查询详情
     *
     * @param id ${@link String}
     * @throws RuntimeException ${@link RuntimeException}
     * @return SysRoleDto ${@link SysRoleDto}
     * @author code generation
     * @date 2020-05-20 14:24:43
     */
    SysRoleDto getById(String id) throws RuntimeException;

    /**
     * 根据用户编号查询角色编码
     * @param userId
     * @return
     */
    List<SysRoleModel> getRoleCodeByUserId(String userId);
}